#include <iostream>
using namespace std;
template<typename T, int MAXSIZE>
class Stack{
	private:
		T elements[MAXSIZE];
		int top; //栈顶
	public:
		Stack():top(0){
		}
		void push(T e);
		T pop();
		bool empty(){
			return top == 0;
		}
		bool full(){
			return top==MAXSIZE;
		}
};
template<typename T, int MAXSIZE>
void Stack<T, MAXSIZE>::push(T e){
	if(full()){
		cout << "stack is full, can not push" << endl;
	}
	elements[top++] = e;
}
template<typename T, int MAXSIZE>
T Stack<T, MAXSIZE>:: pop(){
	if(top == 0){
		cout << "stack is empty, can not pop" << endl;
		return 0;
	}
	top--;
	return elements[top] ;
}
int main(void){
	Stack<int, 10>  iStack;
	return 0;
}
